package com.example.experience.java.controller;

import com.example.experience.java.common.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author : 季荧
 * @ClassName : TestController.java
 * @CreateTime : 2024/7/8 15:02
 * @Description : test
 * @Version : v1.0
 */
@RestController
@RequestMapping("/test")
@Tag(name = "测试Web接口")
public class TestController {

    @GetMapping("/sayHello")
    @Operation(summary = "最简单的测试方法")
    public R sayHello(){
        return R.ok("获取成功", "hello world");
    }

    @GetMapping("/sayError")
    @Operation(summary = "sayError")
    public R sayError(){
        return R.error("失败了");
    }
}
